package AlienArena::Server::Properties;

use 5.006;
use strict;
use warnings;
our $VERSION = '0.01';

sub new {
    my $class = shift;
    my $self = bless {}, $class;
    my ($server, $ip, $port, $pass) = @_;
    $self->_server($server); 
    $self->_ip($ip);
    $self->_port($port);
    $self->_pass($pass);
    return $self;
}

# public getters

sub server { shift->_server }
sub host { shift->_ip }
sub ip { shift->_ip }
sub port { shift->_port }
sub name { shift->_name }
sub admin { shift->_admin }
sub pass { shift->_pass }

# private getter/setters
sub _server {
    my $self = shift;
    return $self->{'_server'} = shift if @_;
    return $self->{'_server'};
}
    
sub _ip {
    my $self = shift;
    return $self->{'_ip'} = shift if @_;
    return $self->{'_ip'};
}

sub _port {
    my $self = shift;
    return $self->{'_port'} = shift if @_;
    return $self->{'_port'};
}

sub _name {
    my $self = shift;
    return $self->{'_name'} = shift if @_;
    return $self->{'_name'};
}

sub _admin {
    my $self = shift;
    return $self->{'_admin'} = shift if @_;
    return $self->{'_admin'};
}

# rcon password
sub _pass {
    my $self = shift;
    return $self->{'_pass'} = shift if @_;
    return $self->{'_pass'};
}



=head1 NAME

AlienArena::Server::Properties - Represents static server properties

=head1 SYNOPSIS

    use AlienArena::Server;
    use AlienArena::Server::Properties;
    my $server = AlienArena::Server->new();
    my $props = AlienArena::Server::Properties->new(
      $server, '127.0.0.1',27901,'fredserv','Fred';
    printf "Server %s: host %s:%s, admin %s\n",
      $props->name, $props->ip, $props->port, $props->admin;

=head1 METHODS

=head2 new($server, $ip, $port, $pass)

=head2 server

=head2 host

=head2 ip

=head2 port

=head2 name

=head2 admin

=head2 pass

=head1 AUTHOR

Mark A. Jensen, C<< <maj -at- fortinbras -dot- us> >>

=head1 LICENSE AND COPYRIGHT

Copyright 2012 Mark A. Jensen.

This program is free software; you can redistribute it and/or modify it
under the terms of either: the GNU General Public License as published
by the Free Software Foundation; or the Artistic License.

See http://dev.perl.org/licenses/ for more information.

=cut

1; # End of AlienArena::Server::Properties
